Component({
	data: {
		selected: 0,
		color: "#797A82",
		selectedColor: "#0E64FE",
		list: [{
				pagePath: "/pages/warehouse/warehouse",
				text: "出入库",
				iconPath: "/static/tabbar/warehouse.png",
				selectedIconPath: "/static/tabbar/warehouse-select.png",
			},
			{
				pagePath: "/pages/home/home",
				text: "仪器总台账",
				iconPath: "/static/tabbar/home.png",
				selectedIconPath: "/static/tabbar/home.png",
			},
			{
				pagePath: "/pages/works/works",
				text: "工作台",
				iconPath: "/static/tabbar/works.png",
				selectedIconPath: "/static/tabbar/works-select.png",
			},
		],
	},
	// 挂载
	attached() {
		console.log("小程序页面初始化完成")
		this.getList()
	},
	methods: {
		switchTab(e) {
			const data = e.currentTarget.dataset;
			const url = data.path;
			wx.switchTab({
				url
			});
			wx.myPageIndex = data.index;
		},
		getList() {
			// const userType = wx.getStorageSync('userType')
			// if (userType == '管理员') {
			// 	this.setData({
			// 		list: list
			// 	})
			// }
		}
	},
});